Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the ClusterListener, ServerListener, ServerMonitorListener API docs relevant to thread-safety #1208

Merged
merged 5 commits into from
Oct 4, 2023

Conversation

stIncMale
Copy link
Member

…API docs relevant to thread-safety

JAVA-5185
@stIncMale stIncMale requested review from rozza and jyemin September 28, 2023 23:16
@stIncMale stIncMale self-assigned this Sep 28, 2023
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the average Java developer will know what "writes to shared memory" means in relation to their Java app.

How about something like:

However, this guarantee does not mean that implementations automatically do not need to synchronize memory accesses to prevent data races. For example, if any data that the listener collects is accessed oustide of the normal execution of the listener by the {@code MongoClient}, then any reading and writing actions must be synchronized.

Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion is optional, if you have similar concerns.

So in essence this is a LGTM.

@stIncMale
Copy link
Member Author

@rozza, I implemented you suggestion, thank you!

Merging, because the static checks have passed, and everything else is irrelevant for the changes in this PR.

@stIncMale stIncMale merged commit c7346ba into mongodb:master Oct 4, 2023
@stIncMale stIncMale deleted the JAVA-5185 branch October 4, 2023 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants